<?php

namespace app\admin\model;

use think\Model;

/**
 * Order
 * @controllerUrl 'userCoupon'
 * @property int id
 * @property int updatetime
 */
class UserCoupon extends Model
{
    // 表名
    protected $name = 'user_coupon';
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    protected $createTime = 'createtime';
    protected $updateTime = false;

    protected $type = [
        'delete_time' => 'timestamp:Y-m-d H:i:s',
    ];

    public function coupon()
    {
        return $this->hasOne(Coupon::class, 'id', 'coupon_id');
    }
}